/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Army.unit;

/**
 *
 * @author Alvis
 */
public class UnitFactory {

	public UnitFactory() {
	}

	public static Unit createUnit(String type, int team, int x, int y) {
		Unit unit = null;
		switch (type) {
			case "worker":
				unit = new UnitWorker(team, x, y);
				break;
			case "archer":
				unit = new UnitArcher(team, x, y);
				break;
			case "swordman":
				unit = new UnitSwordMan(team, x, y);
				break;
			case "spearman":
				unit = new UnitSpearMan(team, x, y);
				break;
		}

		return unit;

	}
/*
	public Unit createUnit(Unit unit, int team, int x, int y) {

		return (Unit) unit.create(team, x, y);

	}*/
}
